<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Adjusts the contrast of an image</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="imagick.shearimage.html">« Imagick::shearImage</a></li>
      <li style="float: right;"><a href="imagick.sketchimage.html">Imagick::sketchImage »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.imagick.html">Imagick</a></li>
    <li>Adjusts the contrast of an image</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="imagick.sigmoidalcontrastimage" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Imagick::sigmoidalContrastImage</h1>
  <p class="verinfo">(PECL imagick 2, PECL imagick 3)</p><p class="refpurpose"><span class="refname">Imagick::sigmoidalContrastImage</span> &mdash; <span class="dc-title">Adjusts the contrast of an image</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-imagick.sigmoidalcontrastimage-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Imagick::sigmoidalContrastImage</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">bool</span> <code class="parameter">$sharpen</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">float</span> <code class="parameter">$alpha</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">float</span> <code class="parameter">$beta</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$channel</code><span class="initializer"> = Imagick::CHANNEL_DEFAULT</span></span><br>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   Adjusts the contrast of an image with a non-linear sigmoidal contrast
   algorithm. Increase the contrast of the image using a sigmoidal transfer
   function without saturating highlights or shadows. Contrast indicates
   how much to increase the contrast (0 is none; 3 is typical; 20 is
   pushing it); mid-point indicates where midtones fall in the resultant
   image (0 is white; 50 is middle-gray; 100 is black). Set sharpen to
   <strong><code>true</code></strong> to increase the image contrast otherwise the contrast is reduced.
  </p>
  <p class="para">
   See also <a href="http://www.imagemagick.org/Usage/color_mods/#sigmoidal" class="link external">&raquo;&nbsp;ImageMagick
   v6 Examples - Image Transformations — Sigmoidal Non-linearity Contrast</a>
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-imagick.sigmoidalcontrastimage-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">sharpen</code></dt>

     <dd>

      <p class="para">
       If true increase the contrast, if false decrease the contrast.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">alpha</code></dt>

     <dd>

      <p class="para">
       The amount of contrast to apply. 1 is very little, 5 is a significant amount, 20 is extreme.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">beta</code></dt>

     <dd>

      <p class="para">
       Where the midpoint of the gradient will be. This value should be in the range 0 to 1 - mutliplied by the quantum value for ImageMagick.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">channel</code></dt>

     <dd>

      <p class="para">
       Which color channels the contrast will be applied to.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-imagick.sigmoidalcontrastimage-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>true</code></strong>。
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-imagick.sigmoidalcontrastimage-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   错误时抛出 ImagickException。
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-imagick.sigmoidalcontrastimage-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2881">
    <p><strong>示例 #1 
     Create a gradient image using <span class="function"><strong>Imagick::sigmoidalContrastImage()</strong></span>
     suitable for blending two images together smoothly, with the blending
     defined by $contrast and $the midpoint
    </strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">generateBlendImage</span><span style="color: #007700">(</span><span style="color: #0000BB">$width</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$height</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$contrast&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$midpoint&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0.5</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">newPseudoImage</span><span style="color: #007700">(</span><span style="color: #0000BB">$width</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$height</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'gradient:black-white'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$quanta&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getQuantumRange</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sigmoidalContrastImage</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$contrast</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$midpoint&nbsp;</span><span style="color: #007700">*&nbsp;</span><span style="color: #0000BB">$quanta</span><span style="color: #007700">[</span><span style="color: #DD0000">"quantumRangeLong"</span><span style="color: #007700">]);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">;&nbsp;<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


</div></div></div></body></html>